import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: () => import('@/views/home')
      },
      {
        path: '/art-cate',
        component: () => import('@/views/article/art-cate.vue')
      },
      {
        path: '/art-list',
        component: () => import('@/views/article/art-list.vue')
      },
      {
        path: '/art-add',
        component: () => import('@/views/article/art-add.vue')
      },
      {
        path: '/user-info',
        component: () => import('@/views/user/user-info.vue')
      },
      {
        path: '/user-avatar',
        component: () => import('@/views/user/user-avatar.vue')
      },
      {
        path: '/user-pwd',
        component: () => import('@/views/user/user-pwd.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  }
]

const router = new VueRouter({
  routes
})

export default router
